Skip to content

Antalya 26.8 Backport of #131001 - Reuse the GCM cipher context between rows in encrypt/decrypt - #2901

Merged
zvonand merged 2 commits into
antalya-26.8from
backports/antalya-26.8/131001
Nov 20, 2026
Merged

zvonand merged 2 commits into
antalya-26.8from
backports/antalya-26.8/131001

Conversation

@blau-ai

@blau-ai blau-ai commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Improve performance of the encrypt, decrypt and tryDecrypt functions in AES-GCM modes by up to 27x with many threads. (ClickHouse#131001 by @mkmkme)

Documentation entry for user-facing changes

...

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

Reuse the GCM cipher context between rows in encrypt/decrypt
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [33803c7]

@blau-ai blau-ai mentioned this pull request Nov 18, 2026
9 of 30 tasks
@zvonand

zvonand commented Nov 20, 2026

Copy link
Copy Markdown
Member

@blau-ai

@blau-ai

blau-ai commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

CI triage for 33803c76

Verdict: 5 failing checks. None are caused by this PR. 3 are pre-existing on antalya-26.8, 1 is an infra timeout, and 1 is a fuzzer crash in pipeline code that this PR doesn't touch. Nothing needs to change in the PR.

Check Classification PR-caused?
Stateless tests (amd_binary, cas s3 storage, parallel): 03770_min_columns_to_activate_adaptive_write_buffer pre-existing ❌
Stateless tests (amd_asan_ubsan, cas s3 storage, parallel, 2/2) infra (job hit its time limit) + same 03770 failure ❌
RegressionTestsRelease / Swarms pre-existing / flaky (node failure feature) ❌
DCO backport merge commits lack a Signed-off-by line (process check) ❌
AST fuzzer (amd_debug, targeted) LOGICAL_ERROR in StrictResizeProcessor, a pipeline bug outside this PR's code ❌ (likely)

This PR only touches src/Functions/FunctionsAES.h (the SQL encrypt/decrypt functions), a perf test, and the new stateless test 04337_encrypt_decrypt_block_modes.


1. 03770_min_columns_to_activate_adaptive_write_buffer (both cas s3 storage lanes)

Code: 241. DB::Exception: Query memory limit exceeded: would use 50.34 MiB (attempt to allocate chunk of 2.00 MiB), maximum: 50.00 MiB. (MEMORY_LIMIT_EXCEEDED)
(in query: insert into metric_log_1 select * from generateRandom() limit 1 settings max_memory_usage = '50Mi' ...)

2. Stateless tests (amd_asan_ubsan, cas s3 storage, parallel, 2/2): job timeout

WARNING: Job timed out: [Stateless tests (amd_asan_ubsan, cas s3 storage, parallel, 2/2)], timeout [12600], exit code [-15]

3. Regression release swarms

✘ [ Fail ] '/swarms/feature/node failure/check restart swarm node'
✘ [ Fail ] '/swarms/feature/node failure/cpu overload'
✘ [ Fail ] '/swarms/feature/node failure/cpu overload all swarm nodes'
  File ".../swarms/tests/node_failure.py", line 108, in run_long_query
    assert result.exitcode in expected_exitcodes

4. DCO

5. AST fuzzer (amd_debug, targeted): server crash

Thread 285 "QueryPipelineEx" received signal SIGABRT, Aborted.
#6  DB::Exception::handleErrorCode (... code=49 ...)            // LOGICAL_ERROR
#11 DB::StrictResizeProcessor::prepare (...) at src/Processors/ResizeProcessor.cpp:216
        output_state = {status = DB::StrictResizeProcessor::OutputStatus::NotActive}
    processor ... plan_step_name = "Aggregating"
  • ResizeProcessor.cpp:216 raises "Invalid status NotActive for associated output". This is a port-state bug in the executor's StrictResizeProcessor (inside an Aggregating step), not in the function code.
  • The fuzzer queries contain encrypt/decrypt/tryDecrypt only because the targeted fuzzer starts from this PR's new test 04337_encrypt_decrypt_block_modes. The functions only compute row values and have no access to processor port state, so the cipher-context reuse change can't produce this assertion.
  • I found no existing issue for this message in Altinity/ClickHouse or ClickHouse/ClickHouse. The server.log artifact goes past the 64 MiB fetch cap, so I couldn't pull out the exact failing query.
  • Next step: re-run the targeted fuzzer. If the crash reproduces, it's worth filing a separate issue about StrictResizeProcessor with the fuzzer artifacts. It doesn't block this backport.

Bottom line: No fix is needed on this PR. Re-run the asan CAS 2/2 shard and the targeted AST fuzzer. 03770 on CAS storage and the swarms node failure scenarios should be tracked separately for antalya-26.8.

Evidence: praktika result_pr.json for this SHA and for #2905/#2910/#2895, the fuzzer job.log gdb trace, and the swarms job log.

@zvonand
zvonand merged commit 869dd84 into antalya-26.8 Nov 20, 2026
307 of 317 checks passed
@zvonand zvonand added the verified Approved for release label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants